package com.guchenbo.erp.inventory.controller;

import com.guchenbo.erp.inventory.dto.InboundRequest;
import com.guchenbo.erp.inventory.dto.OutboundRequest;
import com.guchenbo.erp.inventory.service.InventoryService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.http.ResponseEntity;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * @author guchenbo
 * @date 2025/7/12
 */
@RestController
@RequestMapping("/api/inventory")
public class InventoryController {
    @Autowired
    private InventoryService inventoryService;

    @PostMapping("/inbound")
    public ResponseEntity<String> inbound(@RequestBody InboundRequest request) {
        inventoryService.inbound(request);
        return ResponseEntity.ok("入库成功");
    }

    @PostMapping("/outbound")
    public ResponseEntity<String> outbound(@RequestBody OutboundRequest request) {
        inventoryService.outbound(request);
        return ResponseEntity.ok("出库成功");
    }
}
